<?php
require 'home/controller/Controller.php ';
require 'home/model/MvModel.php';
class MvController extends Controller{
    function __Construct(){
        parent::__Construct();
        $this->model = new MvModel();
    }
    function Mv(){

        $this->display();
    }

    function listPage(){ //某种类型的视频信息列表
        $tid = $_GET['tid'];

        //拿到导航栏数据
        $list = $this->model->getVTypes();
        $this->assign('list',$list);

        //拿到内容数据，即该类所有的视频
        $content = $this->model->getOneTypeList($tid);
        $this->assign('content',$content);

        //为了拿到typename
        $type = $this->model->getTypeByID($tid);
        $this->assign('type',$type);

        //下载排行
        $rankList = $this->model->getRanklist();    //下载排行
        $this->assign('rankList',$rankList);

        $this->display();
    }

    function detail(){
        $vid = $_GET['vid'];

        //拿到导航栏数据
        $list = $this->model->getVTypes();
        $this->assign('list',$list);

        $detail = $this->model->getDetailByID($vid);
        $this->assign('detail',$detail);

        $comment = $this->model->getCommentByID($vid);
        $this->assign('comment',$comment);

        $score = $this->model->getScore($vid);
        $this->assign('score',$score);

        $this->display();

    }
}
?>